package leetcode;

// 双指针
public class MaximumPossibleSize {
    public static void main(String[] args) {

    }

    public static int maximumPossibleSize(int[] nums) {
        int currentMax = 0;
        int max = 0;
        for(int i=0;i<nums.length-1;i++) {
            if (nums[i] <= nums[i + 1]) {
                currentMax = Math.max(currentMax, currentMax + 1);
            }else {
                currentMax = 0;
            }
            max = Math.max(max, currentMax);
        }
        return max;
    }
}
